/*
Navicat SQL Server Data Transfer

Source Server         : sharpsln
Source Server Version : 110000
Source Host           : taketry:1433
Source Database       : SharpSln
Source Schema         : dbo

Target Server Type    : SQL Server
Target Server Version : 110000
File Encoding         : 65001

Date: 2018-03-19 09:55:07
*/


-- ----------------------------
-- Table structure for SYS_MENU
-- ----------------------------
DROP TABLE [dbo].[SYS_MENU]
GO
CREATE TABLE [dbo].[SYS_MENU] (
[ID] varchar(50) NOT NULL ,
[NAME] nvarchar(50) NOT NULL ,
[ICON] varchar(50) NULL ,
[URL] nvarchar(4000) NULL ,
[LEVEL] int NOT NULL DEFAULT ((0)) ,
[PID] varchar(50) NULL ,
[SCORE] numeric(18,3) NOT NULL DEFAULT ((0)) ,
[ENABLED] int NOT NULL DEFAULT ((1)) ,
[ADDEDTIME] datetime NOT NULL DEFAULT (getdate()) ,
[ADDEDUID] varchar(50) NULL ,
[LASTMODIFIED] datetime NULL ,
[LASTMODIFIEDUID] varchar(50) NULL 
)


GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
NULL, NULL)) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'菜单表'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'菜单表'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'ID')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'主键ID'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ID'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'主键ID'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ID'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'NAME')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'菜单名称'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'NAME'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'菜单名称'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'NAME'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'ICON')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'图标'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ICON'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'图标'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ICON'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'URL')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'url地址'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'URL'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'url地址'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'URL'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'LEVEL')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'级别'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'LEVEL'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'级别'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'LEVEL'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'PID')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'父菜单Id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'PID'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'父菜单Id'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'PID'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'SCORE')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'排序分数'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'SCORE'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'排序分数'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'SCORE'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'ENABLED')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'是否启用(1启用，0禁用)'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ENABLED'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'是否启用(1启用，0禁用)'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ENABLED'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'ADDEDTIME')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'添加时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ADDEDTIME'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'添加时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ADDEDTIME'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'ADDEDUID')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'添加用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ADDEDUID'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'添加用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'ADDEDUID'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'LASTMODIFIED')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'最后修改时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'LASTMODIFIED'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'最后修改时间'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'LASTMODIFIED'
GO
IF ((SELECT COUNT(*) from fn_listextendedproperty('MS_Description', 
'SCHEMA', N'dbo', 
'TABLE', N'SYS_MENU', 
'COLUMN', N'LASTMODIFIEDUID')) > 0) 
EXEC sp_updateextendedproperty @name = N'MS_Description', @value = N'最后修改用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'LASTMODIFIEDUID'
ELSE
EXEC sp_addextendedproperty @name = N'MS_Description', @value = N'最后修改用户'
, @level0type = 'SCHEMA', @level0name = N'dbo'
, @level1type = 'TABLE', @level1name = N'SYS_MENU'
, @level2type = 'COLUMN', @level2name = N'LASTMODIFIEDUID'
GO

-- ----------------------------
-- Records of SYS_MENU
-- ----------------------------
INSERT INTO [dbo].[SYS_MENU] ([ID], [NAME], [ICON], [URL], [LEVEL], [PID], [SCORE], [ENABLED], [ADDEDTIME], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'M', N'所有菜单', N' ', N'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ', N'0', null, N'-1.000', N'1', N'2017-11-13 15:24:45.827', N'', N'2018-03-16 23:14:39.960', N'4e60cfc5-5ed3-47c2-9505-b307014a7bfc')
GO
GO
INSERT INTO [dbo].[SYS_MENU] ([ID], [NAME], [ICON], [URL], [LEVEL], [PID], [SCORE], [ENABLED], [ADDEDTIME], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'M00001', N'菜单设置', N'check-square-o', N'/Menu/Index', N'3', N'M0001', N'9000.000', N'1', N'2017-11-13 15:44:19.310', N'', N'2018-03-16 23:01:04.527', N'4e60cfc5-5ed3-47c2-9505-b307014a7bfc')
GO
GO
INSERT INTO [dbo].[SYS_MENU] ([ID], [NAME], [ICON], [URL], [LEVEL], [PID], [SCORE], [ENABLED], [ADDEDTIME], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'M00002', N'用户管理', N'user', N'/User/Index', N'3', N'M0001', N'2.000', N'1', N'2018-03-09 16:52:47.357', N'2018-03-09 16:52:47.356', N'2018-03-09 16:56:06.150', N'4e60cfc5-5ed3-47c2-9505-b307014a7bfc')
GO
GO
INSERT INTO [dbo].[SYS_MENU] ([ID], [NAME], [ICON], [URL], [LEVEL], [PID], [SCORE], [ENABLED], [ADDEDTIME], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'M0001', N'系统管理', N'folder-open', N'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ', N'2', N'M01', N'8999.000', N'1', N'2017-11-13 15:44:19.310', N'', N'2018-03-09 16:52:33.730', N'4e60cfc5-5ed3-47c2-9505-b307014a7bfc')
GO
GO
INSERT INTO [dbo].[SYS_MENU] ([ID], [NAME], [ICON], [URL], [LEVEL], [PID], [SCORE], [ENABLED], [ADDEDTIME], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'M0002', N'AAA', N' ', N'/Menu/Index', N'2', N'M02', N'1.000', N'1', N'2018-03-17 22:16:44.247', N'2018-03-17 22:16:44.246', N'2018-03-19 09:49:36.593', N'4e60cfc5-5ed3-47c2-9505-b307014a7bfc')
GO
GO
INSERT INTO [dbo].[SYS_MENU] ([ID], [NAME], [ICON], [URL], [LEVEL], [PID], [SCORE], [ENABLED], [ADDEDTIME], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'M0003', N'BBB', N' ', N'/User/Index', N'2', N'M02', N'1.000', N'1', N'2018-03-19 09:49:27.547', N'2018-03-19 09:49:27.533', N'2018-03-19 09:49:48.057', N'4e60cfc5-5ed3-47c2-9505-b307014a7bfc')
GO
GO
INSERT INTO [dbo].[SYS_MENU] ([ID], [NAME], [ICON], [URL], [LEVEL], [PID], [SCORE], [ENABLED], [ADDEDTIME], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'M01', N'系统维护', N'cog', N'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ', N'1', N'M', N'9998.000', N'1', N'2017-11-13 15:25:43.903', N'', N'2018-03-09 14:34:14.393', N'4e60cfc5-5ed3-47c2-9505-b307014a7bfc')
GO
GO
INSERT INTO [dbo].[SYS_MENU] ([ID], [NAME], [ICON], [URL], [LEVEL], [PID], [SCORE], [ENABLED], [ADDEDTIME], [ADDEDUID], [LASTMODIFIED], [LASTMODIFIEDUID]) VALUES (N'M02', N'客户管理', N'user-circle', N'                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                ', N'1', N'M', N'1.000', N'1', N'2018-03-09 15:03:07.683', N'2018-03-09 15:03:07.622', N'2018-03-09 15:09:37.760', N'4e60cfc5-5ed3-47c2-9505-b307014a7bfc')
GO
GO

-- ----------------------------
-- Indexes structure for table SYS_MENU
-- ----------------------------

-- ----------------------------
-- Primary Key structure for table SYS_MENU
-- ----------------------------
ALTER TABLE [dbo].[SYS_MENU] ADD PRIMARY KEY ([ID])
GO

-- ----------------------------
-- Uniques structure for table SYS_MENU
-- ----------------------------
ALTER TABLE [dbo].[SYS_MENU] ADD UNIQUE ([NAME] ASC, [LEVEL] ASC)
GO
